<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<body>
		<script>
			console.log(1)

			setTimeout(() => console.log(2))

			Promise.resolve().then(() => console.log(3))

			Promise.resolve().then(() => setTimeout(() => console.log(4), 2000))

			Promise.resolve().then(() => console.log(5))

			setTimeout(() => console.log(6), 1000)

			console.log(7)
		</script>

		<!-- DIV 会在第一轮宏任务和微任务执行完成后进行渲染。这里也就是在 1 7 3 5 打印后，然后再继续执行第二轮宏任务 -->
		<div>DIV</div>
	</body>
</html>
